<template>
    <div id="app"  v-cloak>
        <navBar v-if="$route.meta.nav"></navBar>
        <keep-alive>
            <router-view v-if="$route.meta.keepALive && isRouterAlive"></router-view>
        </keep-alive>
        <router-view v-if="!$route.meta.keepALive && isRouterAlive "></router-view>
        <refreshDom></refreshDom>
        <FooterView v-show="$route.meta.nofooter"></FooterView>
    </div>
</template>

<script>
import FooterView from "./components/Footer/Footer";
import navBar from "./components/nav/commom";
import refreshDom from './components/refresh'
export default {
    name: "App",
    components: {
        FooterView,
        navBar,
        refreshDom
    },
    provide() {
        return {
            reload: this.reload
        };
    },
    data() {
        return {
            isRouterAlive: true
        };
    },
    methods: {
        reload() {
            this.isRouterAlive = false;
            this.$nextTick(function() {
                this.isRouterAlive = true;
            });
        }
    }
};
</script>
<style lang="less" scoped>
#app {
    height: 100%;
}
 [v-cloak] {
    display: none;
  }
</style>




